package June;

import java.util.Scanner;
//加密案例
public class Test03Encryption {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int num= sc.nextInt();
        arrEye2(reverse(encry(split(num))));
    }
    public static int[] split(int arr){//split-拆分
        String arrStr= String.valueOf(arr);
        int[] array=new int[arrStr.length()];
        for (int i = 0; i <arrStr.length() ; i++) {
            array[i]=Character.getNumericValue(arrStr.charAt(i));
        }
        return array;
    }

    public  void arrEye(int[] arr){//以数组形式打印数组的方法
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            if (i<arr.length-1){
                System.out.print(arr[i]+",");
            }else {
                System.out.print(arr[i]);
            }
        }
        System.out.print("]");
    }
    public static void arrEye2(int[] arr){//直接打印数组中的每一个索引
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
        }
    }

    public static int[] encry(int[] arr){//对输入的数字的值+5，然后%10取余
        for (int i = 0; i < arr.length; i++) {
            arr[i]=arr[i]+5;
        }
        for (int i = 0; i < arr.length; i++) {
            arr[i]=(arr[i]%10);
        }
        return arr;
    }

    public static int[] reverse(int[] arr){//将数字倒序排列
        for (int i = 0, j=arr.length-1;i<j; i++,j--) {
            int temp=arr[i];
            arr[i]=arr[j];
            arr[j]=temp;
        }
        return arr;
    }


}
